package com.ly.cloud.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.ly.cloud.dto.SchoolBasicInfoDto;
import com.ly.cloud.service.SchoolBasicInfoService;
import com.ly.cloud.vo.SchoolBasicInfoVo;
import com.ly.cloud.web.utils.WebResponse;

/**
 * @Description:
 * 操作学校基本信息
 * @Author: luhuacong
 * @Date: Create in 2018/12/12
 */
@RestController
@RequestMapping("/schoolInfo")
public class SchoolInfoController {

	 @Autowired
	private SchoolBasicInfoService schoolInfoService;
	

	/** 
	 * Method Name:  getSchoolBasicInfoById
	 * Description:  
	 * 获取学校信息
	 * @return SchoolBasicInfoVo
	 * @author luhuacong
	 * @date: 2018年12月12日
	 */ 
	@RequestMapping(value = "getSchoolBasicInfo", method = RequestMethod.GET)
	public WebResponse<SchoolBasicInfoVo> getSchoolBasicInfo() {
		SchoolBasicInfoVo vo = schoolInfoService.getSchoolInfo();
		return new WebResponse<SchoolBasicInfoVo>().success(vo);
	}
	
	/** 
	 * Method Name:  updateSchoolInfo
	 * Description:  
	 * 修改学校基本信息
	 * @param dto
	 * @return boolean
	 * @author luhuacong
	 * @date: 2018年12月12日
	 */
	@RequestMapping(value = "updateShcoolInfo", method = RequestMethod.POST)
	public WebResponse<Boolean> updateShcoolInfo(@RequestBody SchoolBasicInfoDto dto) {
		boolean isUpdate = schoolInfoService.updateSchoolInfo(dto);
		return new WebResponse<Boolean>().success(isUpdate);
	}
}
